import http from '@/utils/request'
// //用户登录
export const login = (data) => {
  return http({
    url: '/employee/login',
    method: 'post',
    data
  })
}

// //根据id查询用户信息
// export const getEmpInfoById = (id) => {
//   return http({
//     url: '/employee/' + id,
//     method: 'get'
//   })
// }
//添加用户
export const addEmpApi = (data) => {
  return http({
    url: '/employee/add',
    method: 'post',
    data
  })
}

// //分页查询员工
export const getEmpListApi = (params) => {
  return http({
    url: '/employee/select',
    method: 'get',
    params
  })
}

//修改用户信息用户
export const updateEmpApi = (data) => {
  return http({
    url: '/employee/update',
    method: 'put',
    data
  })
}

// //查询用户详情信息
export const getEmpDetailApi = (id) => {
  return http({
    url: '/employee/' + id,
    method: 'get'
  })
}

// //根据id删除用户
// export const delUserById = (id) => {
//   return http({
//     url: '/user/delete/' + id,
//     method: 'delete'
//   })
// }

//文件上传
export const upload = (formData,token) => {
  return http.post('/common/upload', formData, {
    headers: {
      'Content-Type': 'multipart/form-data',
      token
    }
  })
}
